
// lib
// import _ from "lodash";
// config
// script & methods & public
// import logUtils from "utils/logUtils";
// state
// import { dataState } from "state/global";
// http
// import { open, bag, isOkRes } from "public/http/api";
// service
import {
  simpleListService,
  simpleObjectService,
  // simpleListService,
  // simpleObjectService,
  simplePageService,
  simpleResService,
} from "public/service/simple.service";
// api
import {
  API_SOURCE_ADD,
  API_SOURCE_DELETE,
  API_SOURCE_PAGE,
  API_SOURCE_EDIT,
  API_ROOM_ADD,
  API_ROOM_EDIT,
  ReqRoomAddPage,
  API_ROOM_DELETE,
  ReqRoomPage,
  API_ROOM_PAGE,
  ReqShelfAddPage,
  API_SHELF_ADD,
  API_SHELF_EDIT,
  API_SHELF_DELETE,
  API_SHELF_PAGE,
  API_ROOM_ALL,
  ReqSourcePage,
  ReqCategoryAdd,
  ReqCategoryPage,
  ReqSourceAddPage,
  API_CATEGORY_PAGE,
  API_CATEGORY_ADD,
  API_CATEGORY_DELETE,
  API_CATEGORY_EDIT,
  API_PRO_CATEGORY_LONGTREE_PAGE,
  API_CATEGORY_LONG_PAGE,
  API_BOOK_ADD,
  API_BOOK_EDIT,
  API_BOOK_DELETE,
  API_BOOK_PAGE,
  ReqBookAddPage,
  ReqCopyAddPage,
  API_COPY_ADD,
  API_COPY_EDIT,
  API_COPY_DELETE,
  API_COPY_PAGE,



  API_PRO_ATTR_GROUP_ADD,
  API_PRO_ATTR_GROUP_DELETE,
  API_PRO_ATTR_GROUP_EDIT,

  

  API_PRO_PRODUCT_SPU_ADD,
  API_PRO_PRODUCT_SPU_DELETE,
  API_PRO_PRODUCT_SPU_DETAIL,
  API_PRO_PRODUCT_SPU_EDIT,
  API_PRO_PRODUCT_SPU_PAGE,
  API_PRO_PRODUCT_SPU_STATUS_EDIT,
  API_PRO_SHOP_PRODUCT_EDIT,
  API_PRO_SHOP_PRODUCT_PAGE,
  ReqProAttrGroupAddPage,
 
  ReqProProductSpuAdd,
  ReqProProductSpuPage,
  ReqProShopProductEdit,
  ReqProShopProductPage,
  API_SOURCE_NO_PAGE,
  API_SHELF_NO_PAGE,
  API_USER_BOOK_PAGE,



} from "./api";
// interface
// 其它

// 副本--新增
export async function addCopyService(params: ReqCopyAddPage) {
  return simpleResService<ReqCopyAddPage>(API_COPY_ADD, params);
}

// // 副本--编辑
export async function editCopyService(params: ReqCopyAddPage) {
  return simpleResService<ReqCopyAddPage>(API_COPY_EDIT, params);
}

// 副本--删除
export async function deleteCopyService(params: ReqCopyAddPage) {
  return simpleResService<ReqCopyAddPage>(API_COPY_DELETE, params);
}
// // 副本--分页查询
export async function getCopyPageService(params: ReqCopyAddPage) {
  return simplePageService<ReqCopyAddPage, CopyDto>(
    API_COPY_PAGE,
    params,
  );
}
//-----------------------图书
// 图书--新增
export async function addBookService(params: ReqBookAddPage) {
  return simpleResService<ReqBookAddPage>(API_BOOK_ADD, params);
}

// // 图书--编辑
export async function editBookService(params: ReqBookAddPage) {
  return simpleResService<ReqBookAddPage>(API_BOOK_EDIT, params);
}

// 图书--删除
export async function deleteBookService(params: ReqBookAddPage) {
  return simpleResService<ReqBookAddPage>(API_BOOK_DELETE, params);
}
// // 图书--分页查询
export async function getBookPageService(params: ReqBookAddPage) {
  return simplePageService<ReqBookAddPage, BookDto>(
    API_BOOK_PAGE,
    params,
  );
}
export async function getBookOrIsbnPageService(params: ReqBookAddPage) {
  return simplePageService<ReqBookAddPage, BookDto>(
    API_BOOK_PAGE,
    params,
  );
}
// // 图书--用户分页查询
export async function getUserBookPageService(params: ReqBookAddPage) {
  return simplePageService<ReqBookAddPage, BookDto>(
    API_USER_BOOK_PAGE,
    params,
  );
}
//-----------------------书架
// 书架--新增
export async function addShelfService(params: ReqShelfAddPage) {
  return simpleResService<ReqShelfAddPage>(API_SHELF_ADD, params);
}

// // 书架--编辑
export async function editShelfService(params: ReqShelfAddPage) {
  return simpleResService<ReqShelfAddPage>(API_SHELF_EDIT, params);
}

// 书架--删除
export async function deleteShelfService(params: ReqShelfAddPage) {
  return simpleResService<ReqShelfAddPage>(API_SHELF_DELETE, params);
}
// // 书架--分页查询
export async function getShelfPageService(params: ReqShelfAddPage) {
  return simplePageService<ReqShelfAddPage, ShelfDto>(
    API_SHELF_PAGE,
    params,
  );
}
// // 书架--不分页查询
export async function getShelfLongPageService(params: any) {
  return simpleListService<any, ShelfDto>(
    API_SHELF_NO_PAGE,
    params,
  );
}
//-----------------------来源
// 房间--新增
export async function addRoomService(params: ReqRoomAddPage) {
  return simpleResService<ReqRoomAddPage>(API_ROOM_ADD, params);
}

// // 房间--编辑
export async function editRoomService(params: ReqRoomAddPage) {
  return simpleResService<ReqRoomAddPage>(API_ROOM_EDIT, params);
}

// 房间--删除
export async function deleteRoomService(params: ReqRoomAddPage) {
  return simpleResService<ReqRoomAddPage>(API_ROOM_DELETE, params);
}
// // 房间--分页查询
export async function getRoomPageService(params: ReqRoomPage) {
  return simplePageService<ReqRoomPage, RoomDto>(
    API_ROOM_PAGE,
    params,
  );
}
// // 房间--不分页列表
export async function getRoomNoPageService(params: any) {
  return simpleListService<any, RoomDto>(
    API_ROOM_ALL,
    params,
  );
}
//-----------------------图书
// 图书来源--新增
export async function addSourceService(params: ReqSourceAddPage) {
  return simpleResService<ReqSourceAddPage>(API_SOURCE_ADD, params);
}

// // 图书来源--编辑
export async function editSourceService(params: ReqSourceAddPage) {
  return simpleResService<ReqSourceAddPage>(API_SOURCE_EDIT, params);
}

// 图书来源--删除
export async function deleteSourceService(params: ReqSourceAddPage) {
  return simpleResService<ReqSourceAddPage>(API_SOURCE_DELETE, params);
}
// // 图书来源--分页查询
export async function getSourcePageService(params: ReqSourcePage) {
  return simplePageService<ReqSourcePage, SourceDto>(
    API_SOURCE_PAGE,
    params,
  );
}
export async function getSourceLongPageService(params: any) {
  return simpleListService<any, SourceDto>(
    API_SOURCE_NO_PAGE,
    params,
  );
}
// // 图书分类--分页查询
export async function getCategoryPageService(params: ReqCategoryPage) {
  return simplePageService<ReqCategoryPage, CategoryDto>(
    API_CATEGORY_PAGE,
    params,
  );
}

// // 图书分类--新增
export async function addCategoryService(params: ReqCategoryAdd) {
  return simpleResService<ReqCategoryAdd>(API_CATEGORY_ADD, params);
}

// // 图书分类--不分页列表
export async function getCategoryLongPageService(params: any) {
  return simpleListService<any, CategoryDto>(
    API_CATEGORY_LONG_PAGE,
    params,
  );
}

// // 图书分类--编辑
export async function editProCategoryService(params: ReqCategoryAdd) {
  return simpleResService<ReqCategoryAdd>(API_CATEGORY_EDIT, params);
}

// // 图书分类--删除
export async function deleteProCategoryService(params: ReqCategoryAdd) {
  return simpleResService<ReqCategoryAdd>(API_CATEGORY_DELETE, params);
}

// // 图书属性组--新增
export async function addProAttrGroupService(params: ReqProAttrGroupAddPage) {
  return simpleResService<ReqProAttrGroupAddPage>(
    API_PRO_ATTR_GROUP_ADD,
    params,
  );
}

// // 图书属性组--编辑
export async function editProAttrGroupService(params: ReqProAttrGroupAddPage) {
  return simpleResService<ReqProAttrGroupAddPage>(
    API_PRO_ATTR_GROUP_EDIT,
    params,
  );
}

// // 协议规则--删除
export async function deleteProAttrGroupService(
  params: ReqProAttrGroupAddPage,
) {
  return simpleResService<ReqProAttrGroupAddPage>(
    API_PRO_ATTR_GROUP_DELETE,
    params,
  );
}

// // 图书分类--不分页树形列表
export async function getProCategoryLongTreePageService(params: any) {
  return simpleListService<any, CategoryDto>(
    API_PRO_CATEGORY_LONGTREE_PAGE,
    params,
  );
}


// // 店铺图书--分页查询
export async function getProShopProductPageService(
  params: ReqProShopProductPage,
) {
  return simplePageService<ReqProShopProductPage, ProShopProductDto>(
    API_PRO_SHOP_PRODUCT_PAGE,
    params,
  );
}

// // 设置店铺图书库存
export async function setProShopProductService(params: ReqProShopProductEdit) {
  return simpleResService<ReqProShopProductEdit>(
    API_PRO_SHOP_PRODUCT_EDIT,
    params,
  );
}

// // 平台图书信息--新增
export async function addProProductSpuService(params: ReqProProductSpuAdd) {
  return simpleResService<ReqProProductSpuAdd>(API_PRO_PRODUCT_SPU_ADD, params);
}


// // 平台图书信息--分页查询
export async function getProProductSpuPageService(
  params: ReqProProductSpuPage,
) {
  return simplePageService<ReqProProductSpuPage, ProProductSpuDto>(
    API_PRO_PRODUCT_SPU_PAGE,
    params,
  );
}

// // 平台图书信息--详情
export async function getProProductSpuDetailPageService(
  params: ReqProProductSpuAdd,
) {
  return simpleObjectService<ReqProProductSpuAdd, ProProductSpuDto>(
    API_PRO_PRODUCT_SPU_DETAIL,
    params,
  );
}

// // 平台图书信息--删除

export async function deleteProProductSpuService(params: ReqProProductSpuAdd) {
  return simpleResService<ReqProProductSpuAdd>(
    API_PRO_PRODUCT_SPU_DELETE,
    params,
  );
}

// // 平台图书信息--编辑
export async function editProProductSpuService(params: ReqProProductSpuAdd) {
  return simpleResService<ReqProProductSpuAdd>(
    API_PRO_PRODUCT_SPU_EDIT,
    params,
  );
}

// 平台图书信息属性状态--修改
export async function changeStatusProProductSpuService(params: ReqProProductSpuAdd) {
  return simpleResService<ReqProProductSpuAdd>(API_PRO_PRODUCT_SPU_STATUS_EDIT, params);
}
